﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Crystal.CustomControls
{
    public partial class CrystalGroupBox : GroupBox
    {
        public CrystalGroupBox()
        {
            Layout += CrystalGroupBox_InitializeLayout;
            //InitializeComponent();
        }

        private void CrystalGroupBox_InitializeLayout(object sender, System.Windows.Forms.LayoutEventArgs e)
        {
            int[] Values = new int[3];
            if (CommonCustomControls.IsValidString(StyleManager.GetStyle("GroupBoxBackColor"), ref Values))
            {
                e.AffectedControl.BackColor = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            }

            if (CommonCustomControls.IsValidString(StyleManager.GetStyle("GroupBoxForeColor"), ref Values))
            {
                e.AffectedControl.ForeColor = System.Drawing.Color.FromArgb(Values[0], Values[1], Values[2]);
            }
        }
    }
}
